package com.lin.generator.config;

import com.lin.generator.model.Template;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 生成器配置
 *
 * @author 猴哥
 */
@Component
@ConfigurationProperties(prefix = "generator")
public class GeneratorConfig {
	/**
	 * 包名
	 */
	private String packageName;

	/**
	 * 需要去除的前缀
	 */
	private List<String> removePrefixes;

	/**
	 * 作者
	 */
	private String author;

	/**
	 * 要生成的表
	 */
	private List<String> generatorTables;

	/**
	 * mysql类型映射关系
	 */
	private Map<String, List<String>> mysqlTypeMap;

	/**
	 * oracle类型映射关系
	 */
	private Map<String, List<String>> oracleTypeMap;

	/**
	 * 导包映射
	 */
	private Map<String, String> importMap;

	/**
	 * 模板列表
	 */
	private List<Template> templateList;

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public List<String> getRemovePrefixes() {
		return removePrefixes;
	}

	public void setRemovePrefixes(List<String> removePrefixes) {
		this.removePrefixes = removePrefixes;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public List<String> getGeneratorTables() {
		return generatorTables;
	}

	public void setGeneratorTables(List<String> generatorTables) {
		this.generatorTables = generatorTables;
	}

	public Map<String, List<String>> getMysqlTypeMap() {
		return mysqlTypeMap;
	}

	public void setMysqlTypeMap(Map<String, List<String>> mysqlTypeMap) {
		this.mysqlTypeMap = mysqlTypeMap;
	}

	public Map<String, List<String>> getOracleTypeMap() {
		return oracleTypeMap;
	}

	public void setOracleTypeMap(Map<String, List<String>> oracleTypeMap) {
		this.oracleTypeMap = oracleTypeMap;
	}

	public Map<String, String> getImportMap() {
		return importMap;
	}

	public void setImportMap(Map<String, String> importMap) {
		this.importMap = importMap;
	}

	public List<Template> getTemplateList() {
		return templateList;
	}

	public void setTemplateList(List<Template> templateList) {
		this.templateList = templateList;
	}

	@Override
	public String toString() {
		return "GeneratorConfig{" +
				"packageName='" + packageName + '\'' +
				", removePrefixes=" + removePrefixes +
				", author='" + author + '\'' +
				", generatorTables=" + generatorTables +
				", mysqlTypeMap=" + mysqlTypeMap +
				", oracleTypeMap=" + oracleTypeMap +
				", importMap=" + importMap +
				", templateList=" + templateList +
				'}';
	}
}
